package training.vo;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
 * <ol>
 * 	<li>營業員基本資料檔，對應到 table : sales</li>
 * 	<li>請自行利用eclipse建立 getter and setter</li>
 * 	<li>請overwrite toString(), equals(obj) and hashCode()</li>
 * </ol>
 * @author fatsung
 * @version 1.0
 * @created 2013/03/18 上午 9:58:56
 */
@Entity
@Table(name="sales")
@XmlRootElement(name = "sale")
@XmlType(propOrder = { "id", "description", "name", "tel"})
public class Sales implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 6557946612759459937L;

	@Id
	@Column(name="id")
	private String id;
	@Column(name="description")
	private String description;
	@Column(name="name")
	private String name;
	@Column(name="tel")
	private String tel;

	public Sales(){

	}

	public void finalize() throws Throwable {

	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Sales [description=");
		builder.append(description);
		builder.append(", id=");
		builder.append(id);
		builder.append(", name=");
		builder.append(name);
		builder.append(", tel=");
		builder.append(tel);
		builder.append("]");
		return builder.toString();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Sales other = (Sales) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}